export default function (data) { // 1 series

    if(!data){
      data=[]
    }
    var colorList = ['#2994FF', '#5E6FFF', '#32CF83', '#FD6934', '#2FC25B', '#13C2C2', '#1890FF', '#8543E0', '#FFADD2']
    return {
        Option: {
            tooltip: {
                trigger: 'item',
                formatter: '{a} <br/>{b}: {c} ({d}%)'
            },
            series: [
                {
                    name: '访问来源',
                    type: 'pie',
                    radius: ['40%', '70%'],
                    color: data.color,
                    labelLine: {
                        normal: {
                            length: 10,
                            length2: 10,
                            lineStyle: {
                                color: '#333'
                            }
                        }
                    },
                    label: {
                        normal: {
                            formatter: '{b}',
                            borderWidth: 0,
                            borderRadius: 4,
                            rich: {
                                a: {
                                    color: '#333',
                                    fontSize: 16,
                                    lineHeight: 20
                                },
                                hr: {
                                    borderColor: '#333',
                                    width: '100%',
                                    borderWidth: 0.5,
                                    height: 0
                                },
                                b: {
                                    fontSize: 16,
                                    lineHeight: 20,
                                    color: '#333'
                                }
                            }
                        }
                    },
                    data:data.data
                    // data: [{
                    //     value: 135,
                    //     name: '未开工资源'
                    // }, {
                    //     value: 1048,
                    //     name: '开工资源'
                    // }]
                }
            ]
        }
    }
}
